<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<title>Japword</title>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
	<meta content="initial-scale=1.0, user-scalable=no" name="viewport" />
	<link href="css/iwebkit-extend.css" rel="stylesheet" media="screen" type="text/css" />


	<!-- iWebKit-->
	<link href="iwebkit/css/style.css" rel="stylesheet" media="screen" type="text/css" />
	<script src="iwebkit/js/functions.js" type="text/javascript"></script>
	
	<!-- WebApp icon -->
	<script type="text/javascript" src="js/lib/scriptaculous-js-1.9.0/lib/prototype.js"></script>

</head>

<body>

<div id="topbar">
	<div id="title">Japword</div>
</div>
<div id="tributton">
	<div class="links">
		<a href="index.html">Accueil</a><a href="settings.html">Config</a><a id="pressed" href="#">A propos</a>
	</div>
</div>
<div id="content">
	<span class="graytitle">A propos de Japword.</span>
	<ul class="pageitem">
		<li class="textbox">
			<p>
				Japword a été développé par Naxan de Valhalla-Keys et utilise iWebKit.
			</p>
		</li>
	</ul>
</div>

<div id="footer" style="position: fixed; bottom: 0; text-align: center; width: 100%; margin: 0">
	<!-- Support iWebKit by sending us traffic; please keep this footer on your page, consider it a thank you for my work :-) -->
	<a class="noeffect" href="http://snippetspace.com">iPhone site powered by iWebKit</a></div>-->
</div>
<div class="ibutton-bar" id="footer-button">
	<ul id="table-footer-button">
		<li class="footer-button-icon"><img src="images/tab/home.png" /></li>
	</ul>
</div>
<script type="text/javascript">


var iButtonBar = new (function() {
	
	var ibuttonbar;
	var containerIcons;
	var icons;
	var images;
	var $this = this;
	
	function pageWidth() {return window.innerWidth != null? window.innerWidth: document.body != null? document.body.clientWidth:null;}
	function pageHeight() {return window.innerHeight != null? window.innerHeight: document.body != null? document.body.clientHeight:null;}
	
	this.calculateHeight = function() {
		var minHeightPercent = false;
	
		if (ibuttonbar.getStyle("min-height")) {
			var minHeight = ibuttonbar.getStyle("min-height");
			if (minHeight.indexOf("%")) {
				minHeightPercent = parseInt(minHeight)/100;
			}
		}
	
		var heightPercent = parseInt(ibuttonbar.getStyle("max-height"))/100;
		var realWidth = ibuttonbar.offsetWidth;
		var realHeight = pageHeight();
		
		var widthIcon = Math.floor(realWidth / icons.length);
		var percentWidthScreenIcon = (widthIcon / realHeight);
		
		if (percentWidthScreenIcon > heightPercent) {
			widthIcon = Math.floor(heightPercent*realHeight);
		}
		if (minHeightPercent != false && percentWidthScreenIcon < minHeightPercent) {
			widthIcon = Math.floor(minHeightPercent*realHeight);
		}
		alert(widthIcon);
		totalWidth = 0;
		for (var i = 0; i < icons.length; i++) {
			icons[i].style.width = widthIcon+"px";
			icons[i].style.height = widthIcon+"px";
			totalWidth += widthIcon;
		}
		
		for (var i = 0; i < images.length; i++) {
			images[i].width = widthIcon-3;
			images[i].height = widthIcon-3;
		}
		containerIcons.style.width = totalWidth+"px";
		ibuttonbar.style.height = widthIcon+"px";
		
	}
	
	this.refresh = function() {
		ibuttonbar = $$(".ibutton-bar")[0];
		containerIcons = $$(".ibutton-bar ul")[0];
		icons = $$(".ibutton-bar li");
		images = $$(".ibutton-bar li img");
		$this.calculateHeight();
	};

});
document.observe("dom:loaded", function() {
	iButtonBar.refresh();
});
</script>
</body>
</html>
